package com.quiz.bis.enums;

import lombok.Getter;

/**
 * 考试类型枚举
 */
@Getter
public enum ExamTypeEnum {
    EXAM(1, "考试"),
    EVALUATION(2, "测评"),
    HOMEWORK(3, "作业");

    private final Integer code;
    private final String name;

    ExamTypeEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getNameByCode(Integer code) {
        for (ExamTypeEnum value : values()) {
            if (value.getCode().equals(code)) {
                return value.getName();
            }
        }
        return "";
    }
}